import 'package:flutter/material.dart';
import 'package:study_flutter/yzhg/function/beanner/BannerSwipe.dart';
import 'package:study_flutter/yzhg/function/InheritedWidgetDemo.dart';
import 'package:study_flutter/yzhg/function/ProviderDemo.dart';
import 'package:study_flutter/yzhg/function/WillPopScopeDemo.dart';
import 'package:study_flutter/yzhg/function/eventbus/YEventBusDemo.dart';
import 'package:study_flutter/yzhg/function/html/HtmlWidget.dart';
import 'package:study_flutter/yzhg/function/provide/YProvideState.dart';
import 'package:study_flutter/yzhg/function/refresh/YRefreshWidget.dart';
import 'package:study_flutter/yzhg/function/screenutil/FlutterScreenutil.dart';
import 'package:study_flutter/yzhg/function/url/UrlLauncher.dart';
import 'package:study_flutter/yzhg/function/yrouter/YFluroRouter.dart';
import 'package:study_flutter/yzhg/http/FileOperationDemo.dart';
import 'package:study_flutter/yzhg/http/HttpClientDemo.dart';
import 'package:study_flutter/yzhg/http/dio/get_post_dio.dart';
import 'package:study_flutter/yzhg/http/dio/encapsulation_dio_http.dart';
import 'package:study_flutter/yzhg/http/dio_http.dart';
import 'package:study_flutter/yzhg/http/sp/YSharedPreferences.dart';
import 'package:study_flutter/yzhg/project/github/GithubProject.dart';
import 'package:study_flutter/yzhg/project/shop/ShopProject.dart';
import 'package:study_flutter/yzhg/project/shop/pages/goodsdetail/YGoodsDetailPages.dart';
import 'package:study_flutter/yzhg/project/wx_read/WxReadView.dart';

class MConstant {
  /*
   * 创建  功能组件篇路由集合
   */
  static Map<String, WidgetBuilder> getFunctionRoutes(BuildContext context) {
    var routesMap = new Map<String, WidgetBuilder>();
    routesMap[WILL_POP_SCOPE] = (context) => WillPopScopeDemo();
    routesMap[INHERITED_WIDGET_DEMO] = (context) => InheritedWidgetDemo();
    routesMap[PROVIDER_DEMO] = (context) => ProviderDemo();
    routesMap[BANNER_IMAGE] = (context) => BannerSwipe();
    routesMap[FLUTTER_SCREENUTIL] = (context) => FlutterScreenutil();
    routesMap[URL_LAUNCHER] = (context) => UrlLauncher();
    routesMap[REFRESH_WIDGET] = (context) => YRefreshWidget();
    routesMap[PROVIDE_STATE] = (context) => YProvideState();
    routesMap[EVENT_BUS] = (context) => YEventBusDemo();
    routesMap[FLURO_ROUTER] = (context) => YFluroRouter();
    routesMap[FLUTTER_HTML] = (context) => HtmlWidget();

    routesMap[FILE_OPERATION_DEMO] = (context) => FileOperationDemo();
    routesMap[HTTP_CLIENT_DEMO] = (context) => HttpClientDemo();
    routesMap[DIO_HTTP] = (context) => DioHttp();
    routesMap[SHARED_PREFERENCES] = (context) => YSharedPreferences();
    routesMap[GITHUB_PROJECT] = (context) => GithubProject();
    routesMap[WX_READ] = (context) => WxReadView();
    routesMap[SHOP_PROJECT] = (context) => ShopProject();
    /*商品详情页面*/
    routesMap[SHOP_GOODS_DETAIL] = (context) => YGoodsDetailPages();

    //DIO网络请求
    routesMap[DIO_GET_HTTP] = (context) => GetDioHttp();
    routesMap[DIO_ENCAPSULATION_HTTP] = (context) => EncapsulationDioHttp();

    return routesMap;
  }

  /*维护 跳转路由的名称数据*/
  static Map<String, String> getFunctionRoutesName() {
    var routesPath = new Map<String, String>();
    routesPath[WILL_POP_SCOPE] = "导航返回拦截";
    routesPath[INHERITED_WIDGET_DEMO] = "数据共享";
    routesPath[PROVIDER_DEMO] = "跨组件状态共享";
    routesPath[BANNER_IMAGE] = "轮播图的使用";
    routesPath[FLUTTER_SCREENUTIL] = "适配组件";
    routesPath[URL_LAUNCHER] = "打电话，发短信，打开Http,发送邮件";
    routesPath[REFRESH_WIDGET] = "上拉加载，下拉刷新";
    routesPath[PROVIDE_STATE] = "Flutter Provide状态管理";
    routesPath[EVENT_BUS] = "event bus状态管理";
    routesPath[FLURO_ROUTER] = "fluro 路由跳转";
    routesPath[FLUTTER_HTML] = "Flutter Html组件";
    return routesPath;
  }

  /*维护网络请求篇*/
  static Map<String, String> getHttpRoutesName() {
    var routesPath = new Map<String, String>();
    routesPath[FILE_OPERATION_DEMO] = "文件操作";
    routesPath[HTTP_CLIENT_DEMO] = "原生Http请求";
    routesPath[DIO_HTTP] = "dio网络请求";
    routesPath[SHARED_PREFERENCES] = "SP数据储存";
    return routesPath;
  }

  /*项目集合*/
  static Map<String, String> getProjectRoutesName() {
    var routesPath = new Map<String, String>();
    routesPath[GITHUB_PROJECT] = "github项目";
    routesPath[WX_READ] = "微信阅读";
    routesPath[SHOP_PROJECT] = "商城项目";
    return routesPath;
  }

  static String WILL_POP_SCOPE = "willpopscope";
  static String INHERITED_WIDGET_DEMO = "inherited_widget_demo";
  static String PROVIDER_DEMO = "provider_demo";

  //轮播图
  static String BANNER_IMAGE = "banner_image";

  //适配组件
  static String FLUTTER_SCREENUTIL = "flutter_screenutil";

  //打电话，发短信，打开Http,发送邮件
  static String URL_LAUNCHER = "url_launcher";

  //上拉加载 下拉刷新
  static String REFRESH_WIDGET = "refresh_widget";

  /*状态管理*/
  static String PROVIDE_STATE = "provide_state";

  /*EventBus*/
  static String EVENT_BUS = "event_bus";

  /*三方理由框架*/
  static String FLURO_ROUTER = "fluro_router";

  /*Flutter  Html组件*/
  static String FLUTTER_HTML = "flutter_html";

  //文件操作
  static String FILE_OPERATION_DEMO = "file_operation_demo";
  static String HTTP_CLIENT_DEMO = "http_client_demo";
  static String DIO_HTTP = "dio_http";
  static String SHARED_PREFERENCES = "shared_preferences";

  //dio get网络请求
  static String DIO_GET_HTTP = "dio_get_http";
  static String DIO_ENCAPSULATION_HTTP = "dio_encapsulation_http";

  //完整项目
  static String GITHUB_PROJECT = "github_project";
  static String WX_READ = "wx_read_project";
  static String SHOP_PROJECT = "shop_project";

  /*商城项目下面的页面*/
  static String SHOP_GOODS_DETAIL = "goods_detail_pages";
}
